package api;

import conf.App;
import util.HttpClientUtil;
import util.ResponseData;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;

public class LoginApi {
    private static final String login_url= App.BASE_URL+"/system/public/verifyLogin";

    public static ResponseData login(String username,String pwd,String code) throws IOException, URISyntaxException {
        Map<String,String> data=new HashMap<>();
        if(username!=null){
            data.put("username",username);
        } if(pwd!=null){
            data.put("password",pwd);
        } if(code!=null){
            data.put("valicode",code);
        }
        return HttpClientUtil.post_form(login_url,data);
    }
}
